import QtQuick 2.2
import QtQuick.Layouts 1.1
import "./Header"

Rectangle{
    property string menu_pic: "../images/menu0.png"
    signal selectone(bool isselect, int flag)
    signal menuchange()
    signal closePage()
    width: 800; height: 50
    border.color: "gray"; border.width: 1
    RowLayout{     
        id: layout
        anchors.fill: parent
        spacing: 3
        Menu{
            id: head_menu
            picpath: menu_pic
            Layout.fillWidth: true
            Layout.fillHeight: true
            Layout.minimumWidth: 40
            Layout.minimumHeight: 16

            onChoose:
            {
                console.log(qsTr("send message to main -------Header/Menu"))
                selectone(select, flag)
            }
//            Layout.preferredWidth: 93
//            Layout.preferredHeight: 46
//            Layout.minimumWidth: 0
//            Layout.maximumWidth: 300
//        width: parent.width*1*2/12
//        height: parent.height
        }
        Tasks{
            Layout.fillWidth: true
            Layout.fillHeight: true
            Layout.minimumWidth: 20
            Layout.minimumHeight: 16
//            Layout.preferredWidth: 59
//            Layout.preferredHeight: 57
//        width: parent.width/12
//        height: parent.height
        }
        Ctrlstate{
            Layout.fillWidth: true
            Layout.fillHeight: true
            Layout.minimumWidth: 200
            Layout.minimumHeight: 16

            onChoose: {
                console.log(qsTr("send message to main ---------Header/CtrlState"))
                selectone(select, flag);
            }

//            Layout.preferredWidth: 300
//            Layout.preferredHeight: 46
//            width: parent.width*3/4
//            height: parent.height
        }
        Close{
            Layout.fillWidth: true
            Layout.fillHeight: true
            Layout.minimumWidth: 20
            Layout.minimumHeight: 16
//            Layout.preferredWidth: 300
//            Layout.preferredHeight: 46
//            width: parent.width*3/4
//            height: parent.height
            onOnClose:
            {
                closePage()
            }
        }
    }
    onMenuchange: {
        console.log(qsTr("get the \"hide menu\" message from Middle\n\t\t\t==========Header"))
        head_menu.picpath = "../images/menu0.png"
        head_menu.isSelect = false
    }
}
